import { createApp } from 'vue'
import './style.css'
import App from './App.vue'

import { setupRouter } from './router';
import naive from 'naive-ui'
import themeData from './theme/theme-data'

const app = createApp(App);

// 注入全局CSS变量
const styleElement = document.createElement('style');
Object.entries(themeData.value.common).forEach(([key, value]) => {
  document.documentElement.style.setProperty(`--${key}`, value);
});

document.head.appendChild(styleElement);

setupRouter(app);

app.use(naive)

app.mount('#app')
